{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###### Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 D. Koehn, notebook style sheet by L.A. Barba, N.C. Clementi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<link href=\"https://fonts.googleapis.com/css?family=Merriweather:300,300i,400,400i,700,700i,900,900i\" rel='stylesheet' >\n",
       "<link href=\"https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,700,700i\" rel='stylesheet' >\n",
       "<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400' rel='stylesheet' >\n",
       "<style>\n",
       "\n",
       "@font-face {\n",
       "    font-family: \"Computer Modern\";\n",
       "    src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');\n",
       "}\n",
       "\n",
       "\n",
       "#notebook_panel { /* main background */\n",
       "    background: rgb(245,245,245);\n",
       "}\n",
       "\n",
       "div.cell { /* set cell width */\n",
       "    width: 800px;\n",
       "}\n",
       "\n",
       "div #notebook { /* centre the content */\n",
       "    background: #fff; /* white background for content */\n",
       "    width: 1000px;\n",
       "    margin: auto;\n",
       "    padding-left: 0em;\n",
       "}\n",
       "\n",
       "#notebook li { /* More space between bullet points */\n",
       "margin-top:0.5em;\n",
       "}\n",
       "\n",
       "/* draw border around running cells */\n",
       "div.cell.border-box-sizing.code_cell.running { \n",
       "    border: 1px solid #111;\n",
       "}\n",
       "\n",
       "/* Put a solid color box around each cell and its output, visually linking them*/\n",
       "div.cell.code_cell {\n",
       "    background-color: rgb(256,256,256); \n",
       "    border-radius: 0px; \n",
       "    padding: 0.5em;\n",
       "    margin-left:1em;\n",
       "    margin-top: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "div.text_cell_render{\n",
       "    font-family: 'Source Sans Pro', sans-serif;\n",
       "    line-height: 140%;\n",
       "    font-size: 110%;\n",
       "    width:680px;\n",
       "    margin-left:auto;\n",
       "    margin-right:auto;\n",
       "}\n",
       "\n",
       "/* Formatting for header cells */\n",
       ".text_cell_render h1 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-style:regular;\n",
       "    font-weight: bold;    \n",
       "    font-size: 250%;\n",
       "    line-height: 100%;\n",
       "    color: #004065;\n",
       "    margin-bottom: 1em;\n",
       "    margin-top: 0.5em;\n",
       "    display: block;\n",
       "}\t\n",
       ".text_cell_render h2 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-weight: bold; \n",
       "    font-size: 180%;\n",
       "    line-height: 100%;\n",
       "    color: #0096d6;\n",
       "    margin-bottom: 0.5em;\n",
       "    margin-top: 0.5em;\n",
       "    display: block;\n",
       "}\t\n",
       "\n",
       ".text_cell_render h3 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "\tfont-size: 150%;\n",
       "    margin-top:12px;\n",
       "    margin-bottom: 3px;\n",
       "    font-style: regular;\n",
       "    color: #008367;\n",
       "}\n",
       "\n",
       ".text_cell_render h4 {    /*Use this for captions*/\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-weight: 300; \n",
       "    font-size: 100%;\n",
       "    line-height: 120%;\n",
       "    text-align: left;\n",
       "    width:500px;\n",
       "    margin-top: 1em;\n",
       "    margin-bottom: 2em;\n",
       "    margin-left: 80pt;\n",
       "    font-style: regular;\n",
       "}\n",
       "\n",
       ".text_cell_render h5 {  /*Use this for small titles*/\n",
       "    font-family: 'Source Sans Pro', sans-serif;\n",
       "    font-weight: regular;\n",
       "    font-size: 130%;\n",
       "    color: #e31937;\n",
       "    font-style: italic;\n",
       "    margin-bottom: .5em;\n",
       "    margin-top: 1em;\n",
       "    display: block;\n",
       "}\n",
       "\n",
       ".text_cell_render h6 { /*use this for copyright note*/\n",
       "    font-family: 'Source Code Pro', sans-serif;\n",
       "    font-weight: 300;\n",
       "    font-size: 9pt;\n",
       "    line-height: 100%;\n",
       "    color: grey;\n",
       "    margin-bottom: 1px;\n",
       "    margin-top: 1px;\n",
       "}\n",
       "\n",
       "    .CodeMirror{\n",
       "            font-family: \"Source Code Pro\";\n",
       "\t\t\tfont-size: 90%;\n",
       "    }\n",
       "/*    .prompt{\n",
       "        display: None;\n",
       "    }*/\n",
       "\t\n",
       "    \n",
       "    .warning{\n",
       "        color: rgb( 240, 20, 20 )\n",
       "        }  \n",
       "</style>\n",
       "<script>\n",
       "    MathJax.Hub.Config({\n",
       "                        TeX: {\n",
       "                           extensions: [\"AMSmath.js\"], \n",
       "                           equationNumbers: { autoNumber: \"AMS\", useLabelIds: true}\n",
       "                           },\n",
       "                tex2jax: {\n",
       "                    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
       "                    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
       "                },\n",
       "                displayAlign: 'center', // Change this to 'center' to center equations.\n",
       "                \"HTML-CSS\": {\n",
       "                    styles: {'.MathJax_Display': {\"margin\": 4}}\n",
       "                }\n",
       "        });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Execute this cell to load the notebook's style sheet, then ignore it\n",
    "from IPython.core.display import HTML\n",
    "css_file = '../style/custom.css'\n",
    "HTML(open(css_file, \"r\").read())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2D and 1D approximations  for linear-elastic and acoustic media\n",
    "\n",
    "While the 3D isotropic linear-elastic equations of motion are a very general medium description, their numerical solutions would be computationally quite demanding on small desktop computers or laptops. Therefore, we derive in this lesson some 2D and 1D approximations to the 3D linear-elastic and acoustic equations of motion"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2D  linear-elastic medium approximations\n",
    "\n",
    "We start again from the 3D equations of motion for an isotropic linear-elastic medium\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{12}}{\\partial x_2} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1 \\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{22}}{\\partial x_2} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{32}}{\\partial x_2} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{22} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{22}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "This time we assume that the material parameters do not change in a certain direction. This approximation is called a 2D medium. Examples for 2D media are canals, sea dikes or walls. \n",
    "\n",
    "Due to the isotropy of the medium we can choose any direction, where no material parameter changes occur. For the following derivations, we take the 2-direction. In the elastic case, we can realize 2D media by two different approaches. First, we could set all displacements in the 2-direction $u_2=0$ and also all derivatives in the 2-direction $\\frac{\\partial}{\\partial x_2}=0$. This leads to the ...\n",
    "\n",
    "### 2D PSV problem\n",
    "\n",
    "To derive the partial differential equations for the 2D PSV problem, I first mark all terms which obviously vanish due to $\\frac{\\partial}{\\partial x_2} = 0$ in red:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\color{red}{\\frac{\\partial \\sigma_{12}}{\\partial x_2}} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1 \\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\color{red}{\\frac{\\partial \\sigma_{22}}{\\partial x_2}} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\color{red}{\\frac{\\partial \\sigma_{32}}{\\partial x_2}} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\color{red}{\\epsilon_{22}}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{22} &= \\lambda(\\epsilon_{11}+\\color{red}{\\epsilon_{22}}+\\epsilon_{33}) + \\color{red}{2 \\mu \\epsilon_{22}}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\color{red}{\\epsilon_{22}}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Notice, that $\\sigma_{22}$ does not occur in the momentum equations anymore, so we can also neglect the $\\sigma_{22}$ equation and get:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Next, we evaluate the shear stresses by inserting the strain tensor components:\n",
    "\n",
    "\\begin{align}\n",
    "\\color{red}{\\sigma_{12}} &\\color{red}{= \\mu \\biggl(\\frac{\\partial u_1}{\\partial x_2} + \\frac{\\partial u_2}{\\partial x_1}\\biggr)}\\nonumber \\\\\n",
    "\\sigma_{13} &= \\mu \\biggl(\\frac{\\partial u_1}{\\partial x_3} + \\frac{\\partial u_3}{\\partial x_1}\\biggr)\\nonumber \\\\\n",
    "\\color{red}{\\sigma_{23}} &\\color{red}{= \\mu \\biggl(\\frac{\\partial u_2}{\\partial x_3} + \\frac{\\partial u_3}{\\partial x_2}\\biggr)}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Do you notice why $\\sigma_{12}$ and $\\sigma_{23}$ (marked in red) are zero? \n",
    "\n",
    "Because, we have either a $u_2 = 0$ component or $\\frac{\\partial}{\\partial x_2}=0$. Therefore, all $\\sigma_{12}$ and $\\sigma_{23}$ terms are zero, which we first mark in red:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\color{red}{\\rho\\frac{\\partial^2 u_2}{\\partial t^2}} &\\color{red}{= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3}} + f_2 \\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\color{red}{\\sigma_{12}} &\\color{red}{= 2 \\mu \\epsilon_{12}}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\color{red}{\\sigma_{23}} &\\color{red}{= 2 \\mu \\epsilon_{23}}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "and then delete the red terms:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Finally, we can rearrange the strain tensor components:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= (\\lambda+2\\mu)\\epsilon_{11} + \\lambda \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda \\epsilon_{11} + (\\lambda + 2 \\mu) \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "and get the partial differential equations for the **2D PSV problem** in the **stress-displacement formulation** by inserting the strain tensor components\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= (\\lambda+2\\mu)\\frac{\\partial u_1}{\\partial x_1} + \\lambda \\frac{\\partial u_3}{\\partial x_3}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda \\frac{\\partial u_1}{\\partial x_1} + (\\lambda + 2 \\mu) \\frac{\\partial u_3}{\\partial x_3}\\nonumber \\\\\n",
    "\\sigma_{13} &= \\mu \\biggl(\\frac{\\partial u_1}{\\partial x_3} + \\frac{\\partial u_3}{\\partial x_1}\\biggr)\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "With the 2D PSV equation we can model the propagation of P and SV waves and,  assuming the correct boundary conditions, Rayleigh waves.\n",
    "\n",
    "Instead of assuming that the $u_2$ component is zero, we could also set $u_1=0$, $u_3=0$ and $\\frac{\\partial}{\\partial x_2} = 0$, while $u_2$ is the only non-zero component. The leads to the ...\n",
    "\n",
    "### 2D SH problem\n",
    "\n",
    "Like for the PSV problem, we first assume, that $\\frac{\\partial}{\\partial x_2} = 0$. As shown above this leads to \n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3\\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Because $u_1=0$, $u_3=0$ and $\\frac{\\partial}{\\partial x_2} = 0$ we can delete the following stress components: \n",
    "\n",
    "\\begin{align}\n",
    "\\color{red}{\\sigma_{11}} &\\color{red}{= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}}\\nonumber \\\\\n",
    "\\color{red}{\\sigma_{33}} &\\color{red}{= \\lambda(\\epsilon_{11}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\color{red}{\\sigma_{13}} &\\color{red}{= 2 \\mu \\epsilon_{13}}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Therefore, these momentum equations are also zero:\n",
    "\n",
    "\\begin{align}\n",
    "\\color{red}{\\rho\\frac{\\partial^2 u_1}{\\partial t^2}} &\\color{red}{= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} + f_1}\\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\color{red}{\\rho\\frac{\\partial^2 u_3}{\\partial t^2}} &= \\color{red}{\\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} + f_3}\\nonumber\n",
    "\\end{align}\n",
    "\n",
    "So the remaining equations are:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "After inserting $\\epsilon_{12}$ and $\\epsilon_{23}$, we get \n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\sigma_{12} &= \\mu \\biggl(\\color{red}{\\frac{\\partial u_1}{\\partial x_2}} + \\frac{\\partial u_2}{\\partial x_1}\\biggr)\\nonumber \\\\\n",
    "\\sigma_{23} &= \\mu \\biggl(\\frac{\\partial u_2}{\\partial x_3} + \\color{red}{\\frac{\\partial u_3}{\\partial x_2}}\\biggr)\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Here, the terms $\\frac{\\partial u_1}{\\partial x_2}$ and $\\frac{\\partial u_3}{\\partial x_2}$ are zero, so we finally get the partial differential equations for the **2D SH problem** in **stress-displacement formulation**\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\sigma_{12} &= \\mu \\frac{\\partial u_2}{\\partial x_1}\\nonumber \\\\\n",
    "\\sigma_{23} &= \\mu \\frac{\\partial u_2}{\\partial x_3}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "With these equations we can describe the propagation of horizontal shear (SH)-waves and Love waves.\n",
    "\n",
    "##### Warning\n",
    "\n",
    "Because the medium is infinitly extending in 2-direction, all sources $f_i$ excitated in the above 2D elastic medium approximations are infinite line sources, compared to the explosive or impact sources used in field data applications. These line sources do not radiate spherical waves, but **cylinder waves**. \n",
    "\n",
    "Therefore, the modelled source radiation patterns and geometrical spreading effects are different from the ones measured in the field. These differences have to be compensated, for example if we want to reconstruct subsurface properties from a field dataset by 2D Full Waveform Inversion.\n",
    "\n",
    "## 1D SH elastic medium approximation\n",
    "\n",
    "The 2D SH problem is already quite compact:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\sigma_{12} &= \\mu \\frac{\\partial u_2}{\\partial x_1}\\nonumber \\\\\n",
    "\\sigma_{23} &= \\mu \\frac{\\partial u_2}{\\partial x_3}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "and therefore computationally not as demanding as the 3D isotropic elastic equations of motion. However, for the introduction to seismic modelling let's see, if we can get rid of another dimension. After inserting the stress tensor components into the momentum equation, we get\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial}{\\partial x_1} \\mu \\frac{\\partial u_2}{\\partial x_1} + \\frac{\\partial}{\\partial x_3} \\mu \\frac{\\partial u_2}{\\partial x_3} + f_2\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "Assuming no variations of the shear modulus $\\mu$ and $u_2$ component in the 3-direction, or $\\frac{\\partial}{\\partial x_3} = 0$, we get the **1D SH problem**\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial}{\\partial x_1} \\mu \\frac{\\partial u_2}{\\partial x_1} + f_2\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "While a point source in a 2D medium radiates cylinder waves, a source in the 1D medium approximation radiates **plane waves**.\n",
    "\n",
    "## 2D and 1D acoustic medium approximations\n",
    "\n",
    "The 2D and 1D acoustic medium approximations are very easy to introduce, because we already derived the **3D acoustic wave equation** in [Lesson 3: Acoustic medium approximation](http://nbviewer.jupyter.org/github/daniel-koehn/Theory-of-seismic-waves-II/blob/master/01_Analytical_solutions/3_Acoustic_medium.ipynb):\n",
    "\n",
    "\\begin{equation}\n",
    "\\frac{1}{V_p^2} \\frac{\\partial^2 P}{\\partial t^2} = \\frac{\\partial^2 P}{\\partial x_1^2} + \\frac{\\partial^2 P}{\\partial x_2^2} + \\frac{\\partial^2 P}{\\partial x_3^2}\\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "By setting $\\frac{\\partial}{\\partial x_2} = 0$, we get the **2D acoustic wave equation** \n",
    "\n",
    "\\begin{equation}\n",
    "\\frac{1}{V_p^2} \\frac{\\partial^2 P}{\\partial t^2} = \\frac{\\partial^2 P}{\\partial x_1^2} + \\frac{\\partial^2 P}{\\partial x_3^2}\\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "and by setting $\\frac{\\partial}{\\partial x_3} = 0$, we get the **1D acoustic wave equation**\n",
    "\n",
    "\\begin{equation}\n",
    "\\frac{1}{V_p^2} \\frac{\\partial^2 P}{\\partial t^2} = \\frac{\\partial^2 P}{\\partial x_1^2}\\nonumber\n",
    "\\end{equation}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## We learned:\n",
    "\n",
    "* Governing equations for wave propagation in 2D/1D linear-elastic and acoustic media"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "widgets": {
   "state": {},
   "version": "1.1.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
